function submitLogin() {
    var username = $("#username").val();
    var password = $("#password").val();

    if(username == ""){
        alert("名字不能为空");
    }else if(password == ""){
        alert("密码不能为空");
    }else{
        $.ajax({
            type: "POST",
            dataType: "text", //数据格式:JSON
            url: '/api/auth/login?username=' + username + '&password='+ password,
            contentType: 'application/json;charset=utf-8',
            data: '{}',//目标地址
            error: function (XMLHttpRequest, textStatus, errorThrown) { },
            success: function (msg){
                var obj = JSON.parse(msg);
                if(obj.error_code == 0){
                    localStorage.setItem("token", obj.token);
                    window.location.href = "http://localhost:8080/marketing/home";
                }else {
                    alert(obj.error_message);
                }
            }
        });
    }
}